<div ng-controller="userListController">

    <div class="query_criteria" style="padding-left: 8px">
        <div class="selece_tj">
            <p>
                <span>姓名：<input class="laydate-icon" type="text" ng-model="userName" placeholder="姓名"/></span>
                <span>工号：</span> <input class="laydate-icon" type="text" ng-model="jobNumber" placeholder="工号"/>
                <span>手机号：</span> <input class="laydate-icon" type="text" ng-model="mobile" placeholder="手机号"/>
                <a href="javascript:void(0)" class="unit-btnSelect" ng-click="getUserList()"> 查 询</a>
            </p>
        </div>
    </div>

<div class="queryDivBox">
    <div class="query_table" style="height: 365px !important;">
        <table class="table table-bordered table-striped">
            <tr>
                <td>姓名</td>
                <td>账号</td>
                <td>工号</td>
                <td>手机号</td>
                <td>邮箱</td>
                <!--<td>公司</td>-->
                <td>部门</td>
                <td>职位</td>
                <td>角色</td>
                <td ng-show='hasShowManager == 1'>操作</td>
            </tr>
            <tr ng-repeat="user in getUser.userList">
                <td ng-bind="user.userName"></td>
                <td ng-bind="user.name"></td>
                <td ng-bind="user.jobNum"></td>
                <td ng-bind="user.mobile"></td>
                <td ng-bind="user.email"></td>
                <!--<td ng-bind="user.companyName"></td>-->
                <td ng-bind="user.department"></td>
                <td ng-bind="user.job"></td>
                <td ng-bind="user.roleNames"></td>
                <td ng-show="hasShowManager == 1">
                    <!--<a href="userDetails.html?username={{username}}">详情</a>-->
                    <a href="javascript:void(0)" class="fcolor" data-toggle="modal" data-target="#deleteUser"
                       data-backdrop="static" ng-click="deleteUserInit(user)">删除</a>
                </td>
            </tr>
        </table>

    </div>

    <div class="pagination datapager fr" style="margin-right: 30px;">
        <ul>
            <li ng-class="{disabled: pageIndex == 0}"><a href="javascript:void(0)" ng-click="prevPage()">上一页</a>
            </li>
            <!--<li><a href="#">当前页 {{pageIndex+1}}</a></li>-->
            <li ng-repeat="n in range(pages)"
                ng-class="{active: n == pageIndex}"
                ng-click="setPage()">
                <a href="javascript:void(0)" ng-bind="n + 1">1</a>
            </li>
            <li ng-class="{disabled: pageIndex == pages - 1}"><a href="javascript:void(0)"
                                                                     ng-click="nextPage()">下一页</a></li>
            <li class="page_allShow"><a href="javascript:void(0)">共<span>{{total}}</span>条</a></li>
        </ul>

    </div >
    <div class="unit-addBox" style="cursor: pointer;">
        <a class="unit-btnSelect" style="font-size: 14px;"
           data-toggle="modal" data-target="#addUser" data-backdrop="static" ng-click="getUserCompany()">+ 新增</a>
    </div>
</div>


    <!-- Modal addUser-->
    <div id="addUser" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
         aria-hidden="true">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h4 id="addUserLabel">新增员工</h4>
        </div>
        <div class="modal-body">
            <div class="container" style="width:530px; padding-bottom:20px">
                <div class="add-user-model">
                    <p>
                        <span>账号：</span><input type="text"  ng-model="newAccount" placeholder="必填"/>
                        <!--<span>公司：</span>-->
                        <!--<select ng-model="selected" ng-options="company.name for company in myCompanyList" style="width: 155px;">-->
                        <!--<option value="company.id"></option>-->
                        <!--</select>-->
                        <span>姓名：</span> <input type="text" ng-model="newUserName" placeholder="必填"/>
                    </p>
                    <p>
                        <span>工号：</span> <input type="text" ng-model="newJobNum" placeholder="必填"/>
                        <span>部门：</span> <input type="text"  ng-model="newDepartment" placeholder="必填"/>
                    </p>
                    <p>
                        <span>职位：</span> <input type="text" ng-model="newJob" placeholder="必填"/>
                    </p>
                     <p class="add-userModel"   ng-show="hasShowManager == 1">
                         <span>角色：</span>
                         <input type="checkbox" name="role" ng-model="myrole.FIRM_WORKER"  value=""/><i style="color: #0e0e0e">设备管理员</i>
                         <input type="checkbox" name="role" ng-model="myrole.FIRM_SCIENTIST"  value=""/><i style="color: #0e0e0e">科学家</i>
                         <i style="padding-left: 6px; color: #2a85a0"> (必填)</i>
                     </p>
                </div>
            </div>
        </div>
        <div class="modal-footer">
            <button class="btn" data-dismiss="modal" aria-hidden="true">关 闭</button>
            <button class="btn btn-primary"  data-dismiss="modal" aria-hidden="true" ng-click="createUserByMe()">保 存</button>
        </div>
    </div>

    <!-- Modal updateUser-->
    <div id="updateUser" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="updateUserLabel"
         aria-hidden="true">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h4 id="updateUserLabel">新增人员</h4>
        </div>
        <div class="modal-body">
            <div class="container" style="width:500px; padding-bottom:20px">
                <div class="add-user-model">
                    <p>
                        <span>姓名：</span><input type="text"/>
                        <span>性别：</span><input type="radio" value="nan"/>男 <input type="radio" value="nv"/>女
                    </p>
                    <p>
                        <span>手机号：</span> <input type="text"/>
                        <span>邮 箱：</span> <input type="text"/>
                    </p>
                    <p>
                        <span>部门：</span> <input type="text"/>
                        <span>职位：</span> <input type="text"/>
                    </p>

                </div>
            </div>
        </div>
        <div class="modal-footer">
            <button class="btn" data-dismiss="modal" aria-hidden="true">关 闭</button>
            <button class="btn btn-primary"  data-dismiss="modal" aria-hidden="true">保 存</button>
        </div>
    </div>

    <!-- Modal deleteUser-->
    <div id="deleteUser" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="deleteUserLabel"
         aria-hidden="true">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h4 id="deleteUserLabel">删除员工并交接</h4>
        </div>
        <div class="modal-body">
            <div class="container" style="width:500px; padding-bottom:20px">
                <div class="add-user-model">
                    <p>请选择交接人：
                        <select ng-model="selectCurrent" ng-options="user.userName for user in selectManagerList">
                            <option value="user.id">--请选择--</option>
                        </select>
                    </p>
                </div>
            </div>
        </div>
        <div class="modal-footer">
            <button class="btn" data-dismiss="modal" aria-hidden="true">关 闭</button>
            <button class="btn btn-primary"  data-dismiss="modal" aria-hidden="true" ng-click="SaveDeleteUserHand()">保 存</button>
        </div>
    </div>
</div>

